<!DOCTYPE html">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
	<script src="JS/jquery-1.9.1.min.js" type="text/javascript"></script>
	<script src="JS/scripts.js" type="text/javascript"></script>
	<script src="googleMapScripts.js" type="text/javascript"></script>
	<link href="http://fonts.googleapis.com/css?family=Oleo+Script" rel="stylesheet" type="text/css">
	<link href="http://fonts.googleapis.com/css?family=Josefin+Sans" rel="stylesheet" type="text/css">
	<link rel="stylesheet" type="text/css" href="CSS/style.css">
	<title>Rescue Me (Please)</title>
</head>
<body onload="loadDefaults('<%=(String)session.getAttribute("userName") %>')">
	<%@ page import="cs236369.hw5.InitListener" %>
	<%
		String name = (String)session.getAttribute("name");
		if(name == null) {
			response.setStatus(403);
			response.sendRedirect(request.getContextPath() + InitListener.welcomePage);
			return;
		}
	%>
	<div id="title" class="title">
	<p><img src="images/logo.jpg" class="logo" /></p>
	<p class="header">
	Rescue Me - Technology for your aid
	</p><p class="text"> Hello <%=name %> (<a href="Logout">Logout</a>)</p>
	</div>
	<div id="navigation">
		<ul>
			<li><a href="searchPost.jsp" class="mainlink">Search</a></li>
			<li><a href="newTeam.jsp" class="mainlink">Add rescue team</a></li>
			<li><a href="newTask.jsp" class="mainlink">Add rescue task</a></li>
			<li><a href="myPosts.jsp" class="mainlink">My posts</a></li>
			<li><a href="editProfile.jsp" class="mainlink">Edit profile</a></li>
			<%	String admin = (String)session.getAttribute("admin");
				if(admin != null) {
					out.print("<li><a href=\"admin.jsp\" class=\"mainlink\">Admin options</a></li>\"");
				}	%>
			<li><a href="about.html" class="mainlink">About</a></li>
		</ul> 
	</div>
	<p class="error" id="errorMessage">
		<%
			String errorMessage = (String)session.getAttribute("message");
			if(errorMessage != null && errorMessage != "") { out.print(errorMessage); }
			session.removeAttribute("message");
		%>
	</p>
	<div id="maincontent"></div>
	<br /><br />
	(C)(R)Eddie Galfrin & Yuval Rotenberg 2013
</body>
	
<script type="text/javascript">
	window.gMapsCallback = function() {
		$(window).trigger('gMapsLoaded');
	};
	
	$(document).ready(function() {
		$(".mainlink").click(function(e) {
			e.preventDefault();
			var link = $(this).attr("href");
			loadToMainContent(link);
		});
	});
</script>
</html>